<?php
  $CI =& get_instance();
  $CI->load->library('totals');
  $unread_message = $CI->totals->new_messages();
  $fname = $this->session->userdata('e_f_name');
  $user_id = $this->session->userdata('userid');
  $username = $this->session->userdata('username');
  $lname = $this->session->userdata('e_l_name');
  $cp_authlink = $this->authlink->generate_authlink();
  $mname = $this->session->userdata('e_m_name');
  $usertype = $this->session->userdata('userType');
?>

<nav class="top-bar">
  <section class="top-bar-section">
    <!-- Left Nav Section -->
    <ul class="title-area">
      <!-- Title Area -->
      <li class="name">
        <h1>
          <a href="#" data-tooltip class="has-tip" title="<?=$this->school_name;?>">
          <?=$this->school_name;?>
        </a>
        </h1>
      </li>
      <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
      <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
    </ul>

    <section class="top-bar-section hide-for-small">
      <ul class="left">
        <li class="divider hide-for-medium-down"></li>
        <li class="name hide-for-medium-down">
          <h1><a href="#" data-tooltip class="has-tip" title="User Account Type">(<?=ucwords($usertype);?> Account)</a></h1>
        </li>
        <li class="divider"></li>
        <li class="name">
          <h1><a href="#" data-tooltip class="has-tip" title="Current Academic Year/School Year"><i class="icon-calendar icon-white"></i> SY: <?=$this->schoolyear_date;?></a></h1>
        </li>
        <li class="divider"></li>
        <li class="name">
          <h1><a href="#" data-tooltip class="has-tip" title="Current Grading Period"><?=ucwords($this->gperiods_current);?></a></h1>
        </li>
    	<li class="name">
    		<h1><a href="<?=site_url('message');?>"><i class="icon-envelope icon-white"></i><span class="message-notifier"><span class="badge badge-important"><?php echo $unread_message; ?></span></span></a></h1>
    	</li>
      </ul>
    </section>
    <ul class="right">
      <li><a href="<?=site_url('registration')?>" class='confirm' title='Are you sure you want to cancel current enrollment?' ><i class="icon icon-off icon-white" style=""></i>&nbsp; Exit Enrollment</a></li>
    </ul>    
  </section>
</nav>